package self.hoy.demo.cloud.seata.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import self.hoy.demo.cloud.seata.dao.AccountMapper;
import self.hoy.demo.cloud.seata.service.AccountService;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;

/**
 * @Author EiletXie
 * @Since 2020/3/18 23:31
 */
@Service
@Slf4j
public class AccountServiceImpl implements AccountService {


    @Resource
    private AccountMapper accountDao;

    @Override
    public void decrease(Long userId, BigDecimal money) {
        log.info("----> account-service中扣减用户余额开始");
        accountDao.decrease(userId, money);
        log.info("----> account-service中扣减用户余额开始");
    }
}
